/* ==================
        初始化
 ==================== */

view,
scroll-view,
swiper,
button,
input,
textarea,
label,
navigator,
image {
    box-sizing: border-box;
}

/* 字体大小全局样式
------------------------------- */
@for $i from 20 through 64 {
    @if $i % 2==0 {
        .font#{$i} {
            font-size: #{$i}rpx !important;
        }
    }
}

.font-bold {
    font-weight: bold;
}

.text-c {
    text-align: center;
}

/* 外边距、内边距全局样式
------------------------------- */
@for $i from 1 through 40 {
    @if $i % 2==0 {
        .mt#{$i} {
            margin-top: #{$i}rpx;
        }

        .mr#{$i} {
            margin-right: #{$i}rpx;
        }

        .mb#{$i} {
            margin-bottom: #{$i}rpx;
        }

        .ml#{$i} {
            margin-left: #{$i}rpx;
        }

        .pt#{$i} {
            padding-top: #{$i}rpx;
        }

        .pr#{$i} {
            padding-right: #{$i}rpx;
        }

        .pb#{$i} {
            padding-bottom: #{$i}rpx;
        }

        .pl#{$i} {
            padding-left: #{$i}rpx;
        }

        .pd#{$i} {
            padding: #{$i}rpx;
        }
    }
}

/* flex 弹性布局
------------------------------- */
.flex {
    display: flex;
}

.flex-auto {
    flex: 1;
}

.flex-column {
    @extend .flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.flex-center {
    @extend .flex;
    justify-content: center;
    align-items: center
}

.align-center {
    @extend .flex;
    align-items: center;
}

.flex-between {
    @extend .align-center;
    justify-content: space-between;
}

.flex-around {
    @extend .align-center;
    justify-content: space-around;
}

.flex-margin {
    margin: auto;
}

.flex-warp {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    margin: 0 -5px;

    .flex-warp-item {
        padding: 5px;

        .flex-warp-item-box {
            width: 100%;
            height: 100%;
        }
    }
}

//字体换行溢出
.text-over {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.fontWeight600 {
    font-weight: bold;
}

/* 宽高 100%
------------------------------- */
.w100 {
    width: 100% !important;
}

.h100 {
    height: 100% !important;
}

.vh100 {
    height: 100vh !important;
}

.max100vh {
    max-height: 100vh !important;
}

.min100vh {
    min-height: 100vh !important;
}